﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
  <%@ include file="/WEB-INF/include/script.jsp"%>

<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
 
</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

  <div class="container-fluid umu-container has-umu-sidemenu">
    <div class="umu-breadcrumb">
      <div class="breadcrumb">自定义报表</div>
    </div>

    <form class="form-horizontal ms-form modal-search-form" role="form" method="GET" action="${ctx.host}/dynamic-report" data-validate="true">
    <div class="panel panel-default beast-panel beast-panel-layout">
      <div class="panel-body">
      <input type="hidden" name="filter" value="true">
      

        <div class="col-xs-12 beast-panel-layout-right">

		<div class="ms-content-layout">
		<div class="form-horizontal ms-form form-personal-info">

             <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-2">请选择报表：</label>
				<div class="col-xs-2">	              
					<select class="select2 form-control" name="reportId" data-validate="required" id="selReportId" tabindex="1" onChange="doChange(this.value,'${ctx.host}');">
		                <option></option>
		                <c:forEach items="${reports}" var="dynamicReport">
		                  <option value="${dynamicReport.id}" <c:if test="${reportId eq dynamicReport.id }">selected</c:if>>${dynamicReport.name}</option>
		                </c:forEach>	
		            </select>
	            </div>
	            <a href="${ctx.host}/dynamic-report/report-upload" class="btn btn-shadow-success btn-shadow umu-btn" data-target="#upload" data-toggle="modal"> 
					  <i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;上传新报表
				</a>
	        </div>          
		<c:forEach items="${columns}" var="column" varStatus="status">
			<c:if test="${status.count%2 != '0' }">
			<div class="form-group  ms-form-group">
			</c:if>
            
	          <label class="control-label col-xs-2">${column}：</label>
				<div class="col-xs-2">	
				<input type="text" placeholder="${column}" name="col${status.count}" />
				</div>              
			<c:if test="${status.count%2 == '0' }">
			</div>
			</c:if>
		
		</c:forEach>
		
		<c:if test="${columnCount%2 != '0'  }">
		</div>
		</c:if>

        </div>


      	</div>
    	</div>

  	</div>
      <div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn btn-shadow-success btn-shadow umu-btn">查询</button>
     </div>
</form>
  	
    </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
<d:resource root="${ctx.resource}/build" type="script" src="js/page/report/dynamic-report.js" />
<script type="text/javascript">
        require([ 'page/report/dynamic-report' ], function(page) {
            page.init();
        })
    </script>
</body>
</html>